package com.teaching.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Properties;

/**
 * TCP服务器常量
 *
 * @author pengz
 * @date 2018/03/16
 */
public class JdbcConstants {

    private static final Logger logger = LoggerFactory.getLogger(JdbcConstants.class);

    public static String SOURCE_HOST;

    public static String SOURCE_PORT;

    public static String SOURCE_DATABASE;

    public static String SOURCE_USER;

    public static String SOURCE_PASSWORD; 

    static {
        try {
            Properties prop = new Properties();
            prop.load(JdbcConstants.class.getResourceAsStream("config/application.properties"));

            SOURCE_HOST = prop.getProperty("source.host");
            SOURCE_PORT = prop.getProperty("source.port");
            SOURCE_DATABASE = prop.getProperty("source.database");
            SOURCE_USER = prop.getProperty("source.user");
            SOURCE_PASSWORD = prop.getProperty("source.password");

        } catch (IOException e) {
            logger.error("载入TCP配置文件出错");
        }
    }

}
